package com.atguigu.gulimall.order.test;

import com.atguigu.gulimall.order.entity.OmsOrderItemEntity;
import com.atguigu.gulimall.order.entity.OmsOrderReturnReasonEntity;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.security.auth.login.Configuration;
import java.io.IOException;
import java.util.Date;


/**
 * @author ming
 * @create 2022/5/8
 * @description:
 */
@Component
@Slf4j
public class MyRabbtListner {
    @RabbitListener(queues = {"hell-java-queue"})
    public void  testListener(Message message, OmsOrderReturnReasonEntity content, Channel channel) throws InterruptedException {
        Thread.sleep(3000);
       log.info("content{}",content);
       //long deliveryTag, boolean multiple //requeue=true 发回服务器,重新入队 requeue=false丢掉
       //channel.basicAck();
       //channel.basicReject();
       log.info("消息处理完成"+ content.getName());

    }


}
